package com.zhouyu;

import com.zhouyu.beanconfig.SunnyAutoConfiguration;
import com.zhouyu.beanconfig.SunnyDeferredImportSelector;
import com.zhouyu.beanconfig.SunnyDeferredImportSelectorGroupProcess;
import com.zhouyu.beanconfig.SunnyImportSelector;
import com.zhouyu.entity.User;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

@SpringBootApplication
//@Import(SunnyAutoConfiguration.class)
//@Import(SunnyImportSelector.class)
//@Import(SunnyDeferredImportSelector.class)
@Import(SunnyDeferredImportSelectorGroupProcess.class)
public class MyApplication {


	@Bean
	public User user(){
		return new User("MyApplication");
	}

//	@Bean
//	public User user123(){
//		return new User();
//	}

	public static void main(String[] args) {
		ConfigurableApplicationContext run = SpringApplication.run(MyApplication.class, args);

		System.out.println(run.getBean("user"));
	}

}
